{extend name="index_layout"/}
{block name="main"}
<form class="layui-form" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">日期</label>
        <div class="layui-input-block">
            {:Form::datetime("row[date]",'',['class'=>'layui-input'])}
        </div>
    </div>

    <input type="hidden" name="row[tid]" value="{$tid}">


    <div class="layui-form-item">
        <label class="layui-form-label">订单ID</label>
        <div class="layui-input-block">
            <input id="c-nums" lay-verify="required" class=" layui-input" name="row[order_id]" type="text">
        </div>
    </div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
layui.use(['yznForm','laydate'], function() {
    var yznForm = layui.yznForm;
    var laydate = layui.laydate;
    laydate.render({
        elem: '#date1'
    });
    yznForm.bindevent($("form.layui-form"));
});

$('#c-price').blur(function() {
   var nums =  $('#c-nums').val()
   var price =  $('#c-price').val()
    if(nums && price){
        $('#c-money').val(nums * price)
    }

});


$('#c-goods-price').blur(function () {
    var nums =  $('#c-nums').val()
    var price =  Number($('#c-price').val())
    var goods_price =  Number($('#c-goods-price').val())
    if(nums && price && goods_price){
        console.log(price + goods_price)
        $('#c-total-money').val((price + goods_price) * nums)
    }


})


$('#c-nums').blur(function() {
    var nums =  $('#c-nums').val()
    var price =  $('#c-price').val()
    if(nums && price){
        $('#c-money').val(nums * price)
    }

});

</script>
{/block}